<template>
    <div class="">
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item><i class="el-icon-message"></i>&nbsp;印厂库详情</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <el-form  label-width="160px">
                <el-form-item label="印厂库ID：">
                    <div>
                        {{data.id}}
                    </div>
                </el-form-item>
                <el-form-item label="封面图：">
                    <div>
                        <img :src="data.head_img" style="width:300px;height300px;"/>
                    </div>
                </el-form-item>
                <el-form-item label="详情图：">
                    <div class="sola-upload clearfix">
                        <div class="sola-left clearfix" v-show="data.banner_img">
                            <div v-for="(item, index) in data.banner_img" class="sola-flex" :key="index">
                                <img  :src="item" />
                            </div>
                        </div>
                    </div>
                 </el-form-item>
                <el-form-item label="营业执照：">
                    <div class="sola-upload clearfix">
                        <div class="sola-left clearfix" v-show="data.business_license">
                            <div v-for="(item, index) in data.business_license" class="sola-flex" :key="index">
                                <img  :src="item" />
                            </div>
                        </div>
                    </div>
                 </el-form-item>
                <el-form-item label="发布者用户ID：">
                    <div>
                        {{data.user_id}}
                    </div>
                </el-form-item>
                <el-form-item label="发布者昵称：">
                    <div>
                        {{data.nick_name}}
                    </div>
                </el-form-item>
                <el-form-item label="分类名称：">
                    <div>
                        {{data.category_name}}
                    </div>
                </el-form-item>
                <el-form-item label="分站：">
                    <div>
                        {{data.city_name}}
                    </div>
                </el-form-item>
                <el-form-item label="公司名称：">
                    <div>
                        {{data.company_name}}
                    </div>
                </el-form-item>
                <el-form-item label="联系人：">
                    <div>
                        {{data.contact}}
                    </div>
                </el-form-item>
                <el-form-item label="电话：">
                    <div>
                        {{data.mobile}}
                    </div>
                </el-form-item>
                <el-form-item label="地址：">
                    <div>
                        {{data.address}}
                    </div>
                </el-form-item>
                <el-form-item label="人员规模：">
                    <div>
                        {{data.person_scale}}
                    </div>
                </el-form-item>
                <el-form-item label="主营业务：">
                    <div>
                        {{data.main_business}}
                    </div>
                </el-form-item>
                <el-form-item label="主要设备：">
                    <div>
                        {{data.main_device}}
                    </div>
                </el-form-item>
                <el-form-item label="主要荣誉：">
                    <div>
                        {{data.main_honor}}
                    </div>
                </el-form-item>
                <el-form-item label="主要资质：">
                    <div>
                        {{data.main_qualification}}
                    </div>
                </el-form-item>
                <el-form-item label="审核状态：">
                    <div>
                        {{data.is_checked | formatStatus}}
                    </div>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="returnList">返回列表</el-button>
                </el-form-item>
            </el-form>
        </div>
       
    </div>
</template>
<script>
import {pressProductWatch} from '@/api/press'
export default {
    name:"pressProductWatch",
    data() {
        return {
            id:0, //ID
            data:{},
        }
    },
    filters: {
	     formatStatus: function (val) {
	       if(val == 0){
	       	return "待审核";
	       }else if(val == 1){
	       	return "审核不通过";
	       }else{
	       	return "审核通过";
	       }
	    },
	},
    //实例创建
    created(){
        if(this.$route.query.id &&this.$route.query.id!=""){
            this.id = this.$route.query.id;
            this.getData();
        }else{
            //学院详情
            alert("获取印厂库详情ID失败")
        }
    },
    //计算属性
    computed:{

    },
    //方法
    methods: {
        //获取学院资讯详情
        getData(){
            // console.log(this.id)
            pressProductWatch(this.id).then(res=>{
                // console.log(res);
                if(res.code==200){
                     var data = res.data;
                     data.banner_img = JSON.parse(data.banner_img);
                     data.business_license = JSON.parse(data.business_license);
                    this.data = data;
                    console.log(data);
                }else{

                }

            })
        },
        //返回列表
        returnList (){
          this.$router.go(-1);
        }
    }
}
</script>
<style lang="stylus" scoped>
    .el-form-item .el-cascader{
        width :400px;
    }
    .el-cascader-menus .el-cascader-menu{
        width :240px
    }
    .sola-upload{
        .sola-left{
            width :100%;
            height :auto;
            .sola-flex{
                float:left
                width: 360px;
                height: 180px;
                margin-bottom 20px;
                margin-right:15px;
                position:relative;
                .delete{
                    position:absolute;
                    top:2px;
                    right:13px;
                    color: #f56c6c;
                    display:inline-block;
                    padding:5px 5px;
                    .el-alert__icon{font-size:28px;cursor:pointer}
                }
                img {
                    width:100%;
                    height:100%;
                }
            }
        }
        .sola-file-box{
            position:relative;
            .btn-file{
                position:absolute;
                top:0;
                left:0;
                z-index 1;
                opacity:0;
                width :120px;
                height :40px;
                outline: 0;
                background-color :none;
                cursor:pointer;
            }
        }

    }
</style>


